package com.kfm.goods.mapper;

import com.kfm.goods.domain.Dept;
import com.kfm.goods.domain.DeptDTO;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author 10854
* @description 针对表【dept】的数据库操作Mapper
* @createDate 2023-11-08 09:30:11
* @Entity com.kfm.goods.domain.Dept
*/
public interface DeptMapper {

    int deleteByPrimaryKey(Long id);

    int insertSelective(Dept record);

    @Results(id="deptResult", value = {
            @Result(property = "id", column = "dept_id", id = true),
            @Result(property = "deptName", column = "dept_name"),
            @Result(property = "descr", column = "descr")
    })
    @Select("select id dept_id, dept_name, descr from dept where id = #{id}")
    Dept selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Dept record);


    List<DeptDTO> selectAllWithUsers();
    List<DeptDTO> selectAllWithUsers2();

}
